package com.byzk.p2p.admin.borrow.dao;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.byzk.p2p.admin.borrow.dto.Change;
import com.byzk.p2p.admin.borrow.dto.ChangeRecord;
import com.byzk.p2p.admin.borrow.vo.AllowChangeVo;
import com.byzk.p2p.admin.borrow.vo.ChangeVo;
import com.byzk.p2p.admin.borrow.vo.MyChangeVo;
import com.byzk.p2p.admin.money.vo.BorrowPaymentDetailVo;

public interface ChangeDao {

	public Integer countChange(Map<String, Object> queryMap);
	
	public List<ChangeVo> listChange(Map<String, Object> queryMap);
	
	public Integer insert(Change change);

	public Integer update(Change change);
	
	public Integer delete(Integer id);
	
	public Integer insertRecord(ChangeRecord changeRecord);
	
	public Integer updateRecord(ChangeRecord changeRecord);
	
	public List<ChangeRecord> selectByChangeId(int changeId);
	
	public List<MyChangeVo> listByChangeUserId(Change change);
	
	public ChangeVo selectById(Integer changeId);
	
	public Change getById(Integer id);
	
	public List<ChangeVo> top3ChangeList();
	
	public Change getChangeByTenderIdAndBorrowId(@Param("borrowId")Integer borrowId,@Param("tenderId")Integer tenderId);
	
	public List<BorrowPaymentDetailVo> getChangePaymentDetailRecord(@Param("borrowId")Integer borrowId,@Param("userId")Integer userId,@Param("changeId")Integer changeId);
	
	public Double getChangePaymentDetailRecordMoney(@Param("borrowId")Integer borrowId,@Param("userId")Integer userId,@Param("changeId")Integer changeId);
	
	public Integer updateChangeBorrowPaymentDetail(@Param("userId")Integer userId,@Param("borrowId")Integer borrowId,@Param("tenderId")Integer tenderId);
	
	public Change getChangeByTenderIdAndBorrowIdAndUserId(@Param("borrowId")Integer borrowId,@Param("userId")Integer userId,@Param("tenderId")Integer tenderId);
	
	public Double sumChangeNotPaymentMoney(@Param("borrowId")Integer borrowId,@Param("userId")Integer userId,@Param("tenderId")Integer tenderId);
	
	public int changeCount(Change cahnge);
	
	public List<AllowChangeVo> changeListByChangeUserId(Integer id);
	
	public Change changeByTenderIdAndBorrowId(@Param("borrowId")Integer borrowId,@Param("tenderId")Integer tenderId);
	
	
	public Change getChangeByTenderIdAndBorrowIdAndChangeUserId(@Param("borrowId")Integer borrowId,@Param("changeUserId")Integer changeUserId,@Param("tenderId")Integer tenderId);
}
